import jsonp from 'common/js/jsonp'
import { commonParams, options } from './config'
// import axios from 'axios'
const urls = require('./yinyue')

export function getRecommend () {
  const url = 'https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg'

  const data = Object.assign({}, commonParams, {
    platform: 'h5',
    uin: 0,
    needNewCode: 1
  })

  return jsonp(url, data, options)
}
// cgi-bin/musicu.fcg
export function getDiscList () {
  return urls
  // return axios.get({ url: urls }
  // ).then((res) => {
  //   return Promise.resolve(res.data)
  // }).catch((err) => {
  //   console.log(err)
  // })
}
export function getSongList (disstid) {
  const url = 'https://c.y.qq.com/qzone/fcg-bin/fcg_ucc_getcdinfo_byids_cp.fcg'

  const data = Object.assign({}, commonParams, {
    disstid,
    type: 1,
    json: 1,
    utf8: 1,
    onlysong: 0,
    platform: 'yqq',
    hostUin: 0,
    needNewCode: 0
  })

  return jsonp(url, data, options)
}
